<?php

namespace App\Http\Middleware;

use Closure;

class SetBearerToRequestHeader
{

    /**
     * @param $request
     * @param Closure $next
     * @return mixed
     * @author Bob(bobcoder@qq.com)
     */
    public function handle($request, Closure $next)
    {
        $request->headers->set('Authorization', 'Bearer ' . $request->header('token'));

        return $next($request);
    }
}
